Skip to content

Conversation

@swasti16
Copy link
Contributor

No description provided.

@swasti16 swasti16 force-pushed the swasti/add_tag_line_column branch from 3678766 to 4ab71fc Compare January 19, 2026 16:32
@swasti16 swasti16 changed the title WIP: Add tag line and column in typedef-info in dump file Fix #14413 : Add tag line and column in typedef-info in dump file Jan 19, 2026
@swasti16 swasti16 force-pushed the swasti/add_tag_line_column branch from 4ab71fc to 812f3f7 Compare January 19, 2026 17:34
@swasti16 swasti16 force-pushed the swasti/add_tag_line_column branch from 812f3f7 to 4d5a1f8 Compare January 20, 2026 05:42
@sonarqubecloud
Copy link

"}\n");
ASSERT_EQUALS(" <typedef-info>\n"
" <info name=\"fp16\" file=\"file.c\" line=\"2\" column=\"1\" used=\"1\" isFunctionPointer=\"1\">\n"
" <info name=\"fp16\" file=\"file.c\" line=\"2\" column=\"1\" tagline=\"2\" tagcolumn=\"17\" used=\"1\" isFunctionPointer=\"1\">\n"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as far as I see there is no tagname in any typedef in this example. I think a tagname always follows after a struct/enum keyword.

typedefInfo.tagColumn = typedefInfo.column;
typedefInfo.used = false;
typedefInfo.isFunctionPointer = isFunctionPointer(typeName);
if (typedefInfo.isFunctionPointer) {
Copy link
Owner

@danmar danmar Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know we talked about it but I feel skeptic about removing this condition.

Maybe you can search for the tagname like this:

    if (Token::Match(typeDef->next(), "struct|enum|class|union %name% {") && typeDef->strAt(2) == typeName->str())
           typedefInfo.tagToken = typeDef->tokAt(2);
    else
           typedefInfo.tagToken = nullptr;

There might be some alternative syntax we want to handle later but we could start with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants